package com.hitqz.robot.api.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;

/**
 * 机器人控制按钮
 */

@TableName(value = "button")
@Schema(description = "控制按钮")
public class Button {

	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	@Schema(description = "按钮来源对象--分组")
	private String object;

	@Schema(description = "是否展示")
	private boolean isShow;

	@Schema(description = "按钮名称")
	private String name;

	@Schema(description = "按钮操作")
	private String action;

	@Schema(description = "是否长按")
	private boolean isLongClick;

	//@Schema(description = "按钮类型 0-点击触发 1-长按触发 2-")
	//private Integer buttonType;

	@Schema(description = "请求类型")
	private String postType = "post";

	@Schema(description = "请求参数")
	private String param;

	@Schema(description = "请求数据类型")
	private String dataType = "json";

	@Schema(description = "展示按钮图片")
	private String showBtnPicUrl;

	@Schema(description = "点击按钮图片")
	private String clickedBtnPicUrl;

	@Schema(description = "地图操作")
	private String mapAction;

	@Schema(description = "禁止图片")
	private String iconNotAllow;


	public static Button createButton(String object,String name,String postType, String action, String param, String picUrl, String picUrlP, String picUrlS,boolean isLongClick) {
		Button button = new Button();
		//默认隐藏，再在web去修改
		button.setIsShow(false);
		button.setObject(object);
		button.setName(name);
		button.setAction(action);
		button.setIsLongClick(isLongClick);
		button.setPostType(postType);
		button.setParam(param);
		button.setDataType("json");
		button.setShowBtnPicUrl(picUrl);
		button.setClickedBtnPicUrl(picUrlP);
		button.setIconNotAllow(picUrlS);
		button.setMapAction("");
		return button;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getObject() {
		return object;
	}

	public void setObject(String object) {
		this.object = object;
	}

	public boolean getIsShow() {
		return isShow;
	}

	public void setIsShow(boolean show) {
		isShow = show;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public boolean getIsLongClick() {
		return isLongClick;
	}

	public void setIsLongClick(boolean longClick) {
		isLongClick = longClick;
	}

	public String getPostType() {
		return postType;
	}

	public void setPostType(String postType) {
		this.postType = postType;
	}

	public String getParam() {
		return param;
	}

	public void setParam(String param) {
		this.param = param;
	}

	public String getDataType() {
		return dataType;
	}

	public void setDataType(String dataType) {
		this.dataType = dataType;
	}

	public String getShowBtnPicUrl() {
		return showBtnPicUrl;
	}

	public void setShowBtnPicUrl(String showBtnPicUrl) {
		this.showBtnPicUrl = showBtnPicUrl;
	}

	public String getClickedBtnPicUrl() {
		return clickedBtnPicUrl;
	}

	public void setClickedBtnPicUrl(String clickedBtnPicUrl) {
		this.clickedBtnPicUrl = clickedBtnPicUrl;
	}

	public String getMapAction() {
		return mapAction;
	}

	public void setMapAction(String mapAction) {
		this.mapAction = mapAction;
	}

	public String getIconNotAllow() {
		return iconNotAllow;
	}

	public void setIconNotAllow(String iconNotAllow) {
		this.iconNotAllow = iconNotAllow;
	}
}
